//--------------------------------------------------------------------------------------
// File: OMPexp.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=320437
//--------------------------------------------------------------------------------------

#ifdef _MSC_VER
#pragma once
#endif

#ifndef _XOMP_EXP_H
#define _XOMP_EXP_H

#ifndef _WINDOWS_
# pragma warning( push )
#if __INTEL_COMPILER
# pragma warning( disable: 271 310 )
#elif _MSC_VER
#pragma warning(disable : 4005)
#endif
# include <windows.h>
# pragma warning( pop )
#endif

#if defined(_MSC_VER) && (defined(_WINDOWS) || defined(_WIN32) || defined(_WIN64) || defined(_M_ARM) || defined(_XBOX_ONE) || defined(_M_PPC))
// Exclude rarely-used stuff from Windows headers
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#ifndef STRICT
#define STRICT
#endif

// If app hasn't choosen, set to work with Windows 8 and beyond
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
#if defined(_WIN32_WINNT) && (_WIN32_WINNT < _WIN32_WINNT_WIN8)
#undef _WIN32_WINNT
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT   _WIN32_WINNT_WIN8
#endif
#ifndef WINVER
#define WINVER         _WIN32_WINNT
#endif
#ifndef _WIN32_WINDOWS
#define _WIN32_WINDOWS _WIN32_WINNT
#endif
#endif
#endif

#ifdef __cplusplus
#define EXTERN_C_BEGIN extern "C" {
#define EXTERN_C_END }
#define EXTERN_CC_BEGIN extern "C++" {
#define EXTERN_CC_END }
#else
#define EXTERN_C_BEGIN
#define EXTERN_C_END
#define EXTERN_CC_BEGIN
#define EXTERN_CC_END
#endif

#ifdef __cplusplus
EXTERN_C_BEGIN
#endif

#ifdef __cplusplus
EXTERN_C_END
#endif

#ifdef __cplusplus
#ifndef _EXTERNC
#define _EXTERNC extern "C"
#endif
#ifndef _EXTERNCC
#define _EXTERNCC extern "C++"
#endif
#ifndef _EXTERN
#define _EXTERN extern
#endif
#else
#ifndef _EXTERNC
#define _EXTERNC extern
#endif
#ifndef _EXTERNCC
#define _EXTERNCC extern
#endif
#ifndef _EXTERN
#define _EXTERN extern
#endif
#endif

#ifdef __cplusplus
#define XOMP_EXTERNC extern "C"
#define XOMP_EXTERNCC extern "C++"
#define XOMP_EXTERN extern
#else
#define XOMP_EXTERNC extern
#define XOMP_EXTERNCC extern
#define XOMP_EXTERN extern
#endif


#if defined(_WINDOWS) || defined(_WIN32) || defined(_WIN64) || defined(_M_ARM) || defined(_XBOX_ONE) || defined(_M_PPC)

#if defined(LIB_EXPORTS) || defined( XOMPLIB_EXPORTS)
#ifndef XOMPLIB_IMPORTS
#ifndef XOMPLIB_EXPORTS
#define XOMPLIB_EXPORTS 1
#endif
#endif
#endif

#if !defined(XOMPLIB_EXPORTS)
#ifndef XOMPLIB_IMPORTS
#define XOMPLIB_IMPORTS 1
#endif
#endif

#if defined(LIB_STATIC) || defined( XOMPLIB_STATIC)
#ifndef XOMPLIB_DLL
#ifndef XOMPLIB_STATIC 
#define XOMPLIB_STATIC 1
#endif
#endif
#endif

#ifdef XOMPLIB_STATIC
#define XOMP_LINK_TYPE "s"
#define XOMP_LIB_TYPE ".lib"
#else
#define XOMP_LINK_TYPE ""
#define XOMP_LIB_TYPE ".dll"
#endif

#if (defined(_DLL) || defined(_USRDLL) || defined(_WINDLL) || defined(LIB_DYNAMIC) || defined( XOMPLIB_DLL)) && !defined(_LIB) && !defined( XOMPLIB_STATIC)
#ifndef XOMPLIB_STATIC
#ifndef XOMPLIB_DLL
#define XOMPLIB_DLL 1
#endif
#endif
#endif

#if !defined( XOMPLIB_DLL) && !defined( XOMPLIB_STATIC)
# pragma error ("!!!Your OMP lib type static or dll aren't defined")
#endif

#if (defined(_MSC_VER) || defined(XOMP_VC)) && (!defined(__INTEL_COMPILER) || !defined(XOMP_ICL))
#	define XOMP_COMPILER_STR "vc"
#ifndef XOMP_VC
#	define XOMP_VC 1
#endif
#elif defined(_clang_) || defined(XOMP_CLANG)
#	define XOMP_COMPILER_STR "clang"
#ifndef XOMP_CLANG
#	define XOMP_CLANG 1
#endif
#elif defined( __INTEL_COMPILER ) || defined(XOMP_ICL)
#	define XOMP_COMPILER_STR "icl"
#ifndef XOMP_ICL
#	define XOMP_ICL 1
#endif
#elif defined( __INTEL_COMPILER ) || defined(XOMP_ICC)
#	define XOMP_COMPILER_STR "icc"
#ifndef XOMP_ICC
#	define XOMP_ICC 1
#endif
#endif


#  if defined( XOMPLIB_DLL) && !defined( XOMPLIB_STATIC)
#    if defined(XOMP_VC) || defined(XOMP_ICL)
#      if defined( XOMPLIB_EXPORTS)
#        define XOMP_EXPAPI __declspec(dllexport)
#      elif defined ( XOMPLIB_IMPORTS)
#        define XOMP_EXPAPI __declspec(dllimport)
#      else // XOMPLIB_STATIC  _LIB
#        define XOMP_EXPAPI 
#      endif
#	 else  // XOMPLIB_LIB
#      define XOMP_EXPAPI 
#    endif
#  else  // XOMPLIB_LIB
#      define XOMP_EXPAPI 
#  endif  /* ! XOMPLIB_DLL */

#else
#	define XOMPAPI 
#endif // _WINDOWS


#if defined(_MSC_VER) || defined(XOMP_VC) || defined(XOMP_ICC)
#ifndef XOMP_GLOBALCONST
#if defined( XOMPLIB_DLL)
#define XOMP_GLOBALCONST XOMP_EXTERNC const __declspec(selectany)
#define XOMP_GLOBAL XOMP_EXTERNC __declspec(selectany)
#define XOMP_GLOBALAPI XOMP_EXTERNC XOMP_EXPAPI
#elif defined( XOMPLIB_STATIC)
#define XOMP_GLOBALCONST XOMP_EXTERNC const
#define XOMP_GLOBAL XOMP_EXTERNC
#define XOMP_GLOBALAPI XOMP_EXTERNC XOMP_EXPAPI
#endif
#endif
#else
#define XOMP_GLOBALCONST XOMP_EXTERNC const
#define XOMP_GLOBAL XOMP_EXTERNC
#define XOMP_GLOBALAPI XOMP_EXTERNC XOMP_EXPAPI
#endif


#if defined(_XBOX_ONE)
#		define XOMP_ARCH_STR "XOne"
#elif defined(_M_IX86) || defined(_WIN32)  && !defined(_WIN64)
#		define XOMP_ARCH_STR ""
#  elif defined(_M_X64) || defined(_WIN64)
#		define XOMP_ARCH_STR "64"
#elif defined(_M_PPC)
#		define XOMP_ARCH_STR "X360"
#  elif defined(_M_ARM)
#		define XOMP_ARCH_STR "Arm"
#endif
# if (defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP))
#		define XOMP_FAMILY_STR "Metro"
#endif
#  if (defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP))
#		undef XOMP_ARCH_STR
#		define XOMP_ARCH_STR ""
#		define XOMP_FAMILY_STR "Phone"
#endif
# if (defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP))
#		define XOMP_FAMILY_STR ""
#endif

/**
Calling convention  // currently defined for windows only, needs searching for other platforms
*/
#if defined(_MSC_VER) || defined(XOMP_VC) || defined(XOMP_ICL)
#ifndef XOMP_CALLCONV
#	define XOMP_CALLCONV __cdecl
#endif
#else
#	define XOMP_CALLCONV
#endif

#if (defined(NDEBUG) && defined(_DEBUG) || ((defined(NDEBUG) && defined(DEBUG))))
# pragma error "Exactly one of NDEBUG and _DEBUG needs to be defined by preprocessor"
#endif

#if !defined(XOMP_DEBUG) && (defined(_DEBUG) || defined(DEBUG)) && !defined(NDEBUG)
#define XOMP_DEBUG 1
#endif

#ifdef XOMP_DEBUG
#define XOMP_BUILD_TYPE  "d"
#else
#define XOMP_BUILD_TYPE  ""
#endif

#define XOMP_VERSION_MAJOR 5

#define XOMP_VERSION_MINOR 0

#define XOMP_VERSION_BUILD 20141803

#define XOMP_BUILD_DATE  "2014-03-18 01:44:30 UTC"

#define XOMP_BUILD_YYYY 2014

#define XOMP_BUILD_DDMM 1803

#define XOMP_VERSION_NUM 0x13356EB

#define XOMP_VERSIONSTR "5.0.2014.1803"

#define XOMP_VERSION_STR XOMP_VERSION_MAJOR , XOMP_VERSION_MINOR , XOMP_BUILD_YYYY, XOMP_BUILD_DDMM

#define XOMP_LIB_NAME XOMP_COMPILER_STR "xomp" XOMP_LINK_TYPE XOMP_FAMILY_STR XOMP_ARCH_STR XOMP_BUILD_TYPE

#define XOMP_FILE XOMP_LIB_NAME XOMP_LIB_TYPE

#ifdef XOMPLIB_IMPORTS
#	pragma comment( lib, XOMP_LIB_NAME ".lib")
#endif

#endif /*_XOMP_EXP_H*/
